/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package peticionweb.logica.entidad;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author icardenas
 */
@Entity
@Table(name="cuyea1m")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Cuyea1m.findAll", query = "SELECT c FROM Cuyea1m c")})
public class Cuyea1m implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(nullable = false, length = 4)
    private String ideye;
    @Basic(optional = false)
    @Column(nullable = false, length = 40)
    private String perye;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "cuyea1m", fetch = FetchType.LAZY)
    private List<Cupar1a> cupar1aList;

    public Cuyea1m() {
    }

    public Cuyea1m(String ideye) {
        this.ideye = ideye;
    }

    public Cuyea1m(String ideye, String perye) {
        this.ideye = ideye;
        this.perye = perye;
    }

    public String getIdeye() {
        return ideye;
    }

    public void setIdeye(String ideye) {
        this.ideye = ideye;
    }

    public String getPerye() {
        return perye;
    }

    public void setPerye(String perye) {
        this.perye = perye;
    }

    @XmlTransient
    public List<Cupar1a> getCupar1aList() {
        return cupar1aList;
    }

    public void setCupar1aList(List<Cupar1a> cupar1aList) {
        this.cupar1aList = cupar1aList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (ideye != null ? ideye.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Cuyea1m)) {
            return false;
        }
        Cuyea1m other = (Cuyea1m) object;
        if ((this.ideye == null && other.ideye != null) || (this.ideye != null && !this.ideye.equals(other.ideye))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "peticionweb.logica.entidad.Cuyea1m[ ideye=" + ideye + " ]";
    }
    
}
